win32 theme: Size titlebar icons correctly.
authorBenjamin Otte <otte@redhat.com>
Mon, 22 Feb 2016 03:01:44 +0000 (04:01 +0100)
committerBenjamin Otte <otte@redhat.com>
Mon, 22 Feb 2016 03:37:57 +0000 (04:37 +0100)
Sizing according to
http://web.archive.org/web/20070301202835/http://shellrevealed.com/photos/blog_images/images/4538/original.aspx

gtk/theme/win32/gtk.css

index 2330850e1491029b8554f0ddf09cbfb8482ac6e2..1c958595d8bc1058c9427becdf9590d985724e5d 100644 (file)
@@ -343,11 +343,12 @@ row:selected:hover {
 
 /* Titlebar */
 
-window .titlebar {
+.titlebar {
     background: -gtk-win32-theme-part(window, 1, 1);
+    min-height: -gtk-win32-size(window, cycaption);
 }
 
-window:backdrop .titlebar {
+.titlebar:backdrop {
     background: -gtk-win32-theme-part(window, 1, 2);
 }
 
@@ -355,6 +356,26 @@ window .titlebar:disabled {
     background: -gtk-win32-theme-part(window, 1, 3);
 }
 
+.titlebar button.titlebutton {
+    margin-top: -gtk-win32-size(button, cyedge);
+    margin-bottom: -gtk-win32-size(button, cyedge);
+    margin-right: -gtk-win32-size(button, cxedge);
+    min-width: calc(-gtk-win32-size(button, cxsize) - 2 * -gtk-win32-size(button, cxedge));
+    min-height: calc(-gtk-win32-size(button, cysize) - 2 * -gtk-win32-size(button, cyedge));
+}
+
+/* XXX: headerbar insists on 6px spacing between buttons. Windows doesn't
+ * think so. */
+.titlebar .titlebutton + .titlebutton {
+  margin-left: -6px;
+}
+
+/* XXX: We don't draw icons here, but the GtkImage still sizes itself to 16x16,
+ * so shrink it enough: */
+.titlebar button.titlebutton image {
+  margin: -3px;
+}
+
 .titlebar button.close {
     background-image: -gtk-win32-theme-part(window, 18, 1);
     color: transparent;